package core

import "github.com/ethereum/go-ethereum/crypto"

type memorySizeFunc func(*Stack) (size uint64, overflow bool)

type gasFunc func(*BatchEvm, *Contract, *Stack, *Memory, uint64) (uint64, error) //

type ScopeContext struct {
	Memory       *Memory
	Stack        *Stack
	CallContract *Contract
}

type executeFunc func(pc *uint64, Interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error)

type operation struct {
	execute     executeFunc
	minStack    int
	maxStack    int
	constantGas uint64
	dynamicGas  gasFunc
	// memorySize returns the memory size required for the operation
	memorySize memorySizeFunc

	//flag
	isWriter bool
	returns  bool
	finished bool
}

var emptyCodeHash = crypto.Keccak256Hash(nil)
